package com.coincalf.wallet.blockchain;

public enum TxStateEnum {

    SUCCESS(1, "成功"),
    FAIL(2, "失败"),
    TO_BE_CONFIRMED(3, "待确认"),
    TO_BE_AUDITED(4, "待审核"),
    MANUAL_CONFIRMATION(5, "人工确认"),
    REJECT(6, "驳回"),
    ;

    private final Integer status;

    private final String desc;

    public Integer getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }

    private TxStateEnum(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public static TxStateEnum getTxState(Integer value) {
        for (TxStateEnum plEnum : TxStateEnum.values()) {
            if (plEnum.getStatus().equals(value)) {
                return plEnum;
            }
        }
        return null;
    }
}
